<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Disconnect from the service manager</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.ibase-service-attach.html">« ibase_service_attach</a></li>
      <li style="float: right;"><a href="function.ibase-set-event-handler.html">ibase_set_event_handler »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.ibase.html">Firebird/InterBase 函数</a></li>
    <li>Disconnect from the service manager</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.ibase-service-detach" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ibase_service_detach</h1>
  <p class="verinfo">(PHP 5, PHP 7 &lt; 7.4.0)</p><p class="refpurpose"><span class="refname">ibase_service_detach</span> &mdash; <span class="dc-title">Disconnect from the service manager</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ibase-service-detach-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ibase_service_detach</strong></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$service_handle</code></span>): <span class="type">bool</span></div>

 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.ibase-service-detach-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">service_handle</code></dt>

     <dd>

      <p class="para">
       A previously created connection to the database server.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ibase-service-detach-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>true</code></strong>， 或者在失败时返回 <strong><code>false</code></strong>。
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.ibase-service-detach-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1238">
    <p><strong>示例 #1 <span class="function"><strong>ibase_service_detach()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Attach&nbsp;to&nbsp;the&nbsp;remote&nbsp;Firebird&nbsp;server&nbsp;by&nbsp;ip&nbsp;address<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;((</span><span style="color: #0000BB">$service&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_service_attach</span><span style="color: #007700">(</span><span style="color: #DD0000">'10.1.1.199'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'sysdba'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'masterkey'</span><span style="color: #007700">))&nbsp;!=&nbsp;</span><span style="color: #0000BB">FALSE</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Successfully&nbsp;attached.&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Fetch&nbsp;server&nbsp;version&nbsp;(something&nbsp;like&nbsp;'LI-V3.0.4.33054&nbsp;Firebird&nbsp;3.0')<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$server_version&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_server_info</span><span style="color: #007700">(</span><span style="color: #0000BB">$service</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IBASE_SVC_SERVER_VERSION</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Fetch&nbsp;server&nbsp;implementation&nbsp;(something&nbsp;like&nbsp;'Firebird/Linux/AMD/Intel/x64')<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$server_implementation&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_server_info</span><span style="color: #007700">(</span><span style="color: #0000BB">$service</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">IBASE_SVC_IMPLEMENTATION</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Detach&nbsp;from&nbsp;server&nbsp;(disconnect)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">ibase_service_detach</span><span style="color: #007700">(</span><span style="color: #0000BB">$service</span><span style="color: #007700">)&nbsp;==&nbsp;</span><span style="color: #0000BB">FALSE</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Error&nbsp;on&nbsp;service&nbsp;detach."</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Successfully&nbsp;detached&nbsp;from&nbsp;service."</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Output&nbsp;message&nbsp;on&nbsp;error<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$conn_error&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ibase_errmsg</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #0000BB">$conn_error</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>

</div></div></div></body></html>